-
Notifications
You must be signed in to change notification settings - Fork 42
Add point views #483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add point views #483
Conversation
| missing = AvailablePoint.course_points(course).order!.map(&:name) - awarded | ||
| @missing_points[course_id] = missing | ||
|
|
||
| if awarded.size + missing.size > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
Style/NumericPredicate: Use (awarded.size + missing.size).positive? instead of awarded.size + missing.size > 0.
| @group_completion_ratios = {} | ||
| @awarded_points.keys.each do |course_id| | ||
| course = Course.find(course_id) | ||
| unless course.hide_submissions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/Next: Use next to skip iteration.
| module PointVisualisation | ||
| extend ActiveSupport::Concern | ||
|
|
||
| def set_point_stats(user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming/AccessorMethodName: Do not prefix writer method names with set_.
| end | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EndAlignment: end at 32, 0 is not aligned with module at 2, 1.
| missing = AvailablePoint.course_points(course).order!.map(&:name) - awarded | ||
| @missing_points[course_id] = missing | ||
|
|
||
| if (awarded.size + missing.size).positive? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
| @group_completion_ratios = {} | ||
| @awarded_points.keys.each do |course_id| | ||
| course = Course.find(course_id) | ||
| if course.hide_submissions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/GuardClause: Use a guard clause instead of wrapping the code inside a conditional expression.
| @@ -0,0 +1,32 @@ | |||
| # frozen_string_literal: true. | |||
| module PointVisualisation | |||
| extend ActiveSupport::Concern | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
| @@ -0,0 +1,32 @@ | |||
| # frozen_string_literal: true. | |||
| module PointVisualisation | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/InitialIndentation: Indentation of first line in file detected.
| @missing_points[course_id] = missing | ||
|
|
||
| @percent_completed[course_id] = | ||
| if (awarded.size + missing.size).positive? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentAssignment: Indent the first line of the right-hand-side of a multi-line assignment.
| @@ -0,0 +1,30 @@ | |||
| # frozen_string_literal: true. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true.
Layout/CommentIndentation: Incorrect indentation detected (column 1 instead of 0).
Use PointVisualisation concern to add required variables
3d40c15 to
76ad367
Compare
0e06bd5 to
81b60ec
Compare
70e2419 to
91c8eb5
Compare
9d66300 to
0728cc8
Compare
3974ce8 to
5684048
Compare
a65b1b3 to
ae0f1e8
Compare
Add "my points"-section to course pages, where student can see their points for that course. Also add the possibility to export a csv-file of the points of a specific part (
sheetin the code) of the course.